package StudyGroup;/*
* 从键盘输入，Scanner类的用法的学习
*
* 1、导包：import java.util.Scanner;
* 2、Scanner 实例化
* 3、调用Scanner的相关方法，获取指定类型的变量
*
* 2022.1.11
* Creat By Code J
* */

import java.util.Scanner;

public class ScannerTest {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入你的姓名：");
        String name = scan.next();
        System.out.println(name);

        System.out.print("请输入你的年龄：");
        int age = scan.nextInt();
        System.out.println(age);

        System.out.print("请输入你的体重：");
        double weight = scan.nextDouble();
        System.out.println(weight);

        System.out.print("你是否单身：(true/false)");
        boolean isAlone = scan.nextBoolean();
        System.out.println(isAlone);

    }
}
